<template>
    <v-app>
        <v-container fill-height fluid>
            <v-row align="center" justify="center">
                <v-col md="4">
                    <v-card elevation="2">
                        <v-card-title>登录 </v-card-title>
                        <v-card-text>
                            <v-text-field
                                label="手机号"
                                prepend-icon="mdi-phone"
                            ></v-text-field>
                            <v-text-field
                                label="密码"
                                prepend-icon="mdi-lock"
                            ></v-text-field>
                        </v-card-text>
                        <v-card-actions>
                            <v-btn
                                color="primary"
                                outlined
                                rounded
                                @click="login"
                                >登录</v-btn
                            >
                        </v-card-actions>
                    </v-card>
                </v-col>
            </v-row>
        </v-container>
    </v-app>
</template>
<script>
export default {
    data: () => ({
        code: "",
        error: false,
        allowCode: 379281,
    }),
    methods: {
        login() {
            if (this.code == this.allowCode) {
                this.$router.replace("/index");
            } else {
                this.error = true;
            }
        },
        hideError() {
            this.error = false;
        },
    },
};
</script>
<style scoped>
.main {
    justify-content: center;
}
</style>